//
//  MyCollectionViewCell.m
//  GiftNote
//
//  Created by lanou3g on 15/8/11.
//  Copyright (c) 2015年 GN. All rights reserved.
//

#import "MyCollectionViewCell.h"
#import "UIImageView+WebCache.h"
#import "Screen.h"
@implementation MyCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.artiImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH /2 - 5, SCREEN_WIDTH /2 - 5)];
        _artiImageView.backgroundColor = [UIColor orangeColor];
        
        self.nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, SCREEN_WIDTH /2 - 5 + 10, SCREEN_WIDTH /2 - 5 - 10, 60)];
        _nameLabel.textAlignment = 1;
        _nameLabel.numberOfLines = 3;
        
        self.moneyLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, SCREEN_WIDTH /2 - 5 + 10 + 30 + 5 +30 + 5, 100, 30)];
        _moneyLabel.textAlignment = 1;
       
        self.likeLabel = [[UILabel alloc] initWithFrame:CGRectMake(SCREEN_WIDTH /2 /2 + 10, SCREEN_WIDTH /2 - 5 + 10 + 30 + 5 +30 + 5 , 60, 30)];
        _likeLabel.textAlignment = 1;
        
        UIImageView *view = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"xinxing"]];
        view.frame = CGRectMake(SCREEN_WIDTH /2 /2  , SCREEN_WIDTH /2 - 5 + 10 + 30 + 5 +30 + 5 + 4, 20, 20);
        [self.contentView addSubview:view];
        [self.contentView addSubview:_artiImageView];
        [self.contentView addSubview:_nameLabel];
        [self.contentView addSubview:_moneyLabel];
        [self.contentView addSubview:_likeLabel];
    }
    return self;
}


- (void)setArtiollerModel:(ArtiollerModel *)artiollerModel{
    _artiollerModel = artiollerModel;
    [_artiImageView sd_setImageWithURL:[NSURL URLWithString:_artiollerModel.cover_image_url]];
        _nameLabel.text =  artiollerModel.name;
    _moneyLabel.text = [NSString stringWithFormat:@"￥:%@",artiollerModel.price];
    
    _likeLabel.text = [NSString stringWithFormat:@"%@", artiollerModel.favorites_count];
    
    
}






@end
